package com.atzly.mapper;

import com.atzly.pojo.Blog;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author zlysimida
 * @date 2021/5/16 - 20:56
 */

@Repository
public class BlogMapperImpl implements BlogMapper{

    @Autowired
    private SqlSessionTemplate sqlSession;

    @Override
    public int insertBlog(Blog blog) {
        return sqlSession.getMapper(BlogMapper.class).insertBlog(blog);
    }

    @Override
    public List<Blog> selectByIf(Map<String, Object> map) {
        return sqlSession.getMapper(BlogMapper.class).selectByIf(map);
    }

    @Override
    public List<Blog> selectByChoose(Map<String, Object> map) {
        return sqlSession.getMapper(BlogMapper.class).selectByChoose(map);
    }

    @Override
    public int updateBlog(Map<String, Object> map) {
        return sqlSession.getMapper(BlogMapper.class).updateBlog(map);
    }

    @Override
    public List<Blog> selectByForEach(Map map) {
        return sqlSession.getMapper(BlogMapper.class).selectByForEach(map);
    }

}
